home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / tcprogud.sit / TC Prog Guide / card_52640.txt < prev    next >
Text File  |  1991-02-27  |  717b  |  30 lines

  1. -- card: 52640 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 4755
  5. -- name: 
  6.  
  7.  
  8. -- part contents for background part 4
  9. ----- text -----
  10. The programmer may then use the names TRUE and FALSE in his/her source file, confident that these will be replaced with the constants 1 and 0 upon compilation:
  11.  
  12.     done = FALSE;
  13.     while (!done)
  14.     {
  15.         if ((c = getchar()) == 'x')
  16.             done = TRUE;
  17.         else
  18.                    .
  19.                    .
  20.     }
  21.  
  22. It is good programming practice to use this technique whenever a numerical constant is used, to help identify the purpose of this constant and to simplify future changes:
  23.  
  24.  
  25.  
  26.  
  27.  
  28. -- part contents for background part 7
  29. ----- text -----
  30. 169